<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
		"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Enqrypt: Encrypted storage</title>
	<script src="/static/jquery-1.6.2.min.js" type="text/JavaScript"> </script>
	<script src="/static/jquery-ui-1.8.16.custom.min.js" type="text/JavaScript"> </script>
	<script src="/static/aes.js" type="text/JavaScript"> </script>
	<script src="/static/base.js" type="text/JavaScript"> </script>
	<link type="text/css" rel="stylesheet" href="/static/styles.css" />
	<link type="text/css" rel="stylesheet" href="/static/flick/jquery-ui-1.8.16.custom.css" />
</head>
<body>
<div id="outer_container">

	<div id="inner_container">

	{% if user %}

		<div id="greeting">	Hello {{ user.nickname }}! <a id="lurl" href="{{ lurl }}">Logout</a>
		</div>
		<div id="mp_container">
			<label for="master_passwd">Master password: </label><input type="password" id="master_passwd" />
		</div>
		<table id="raw_data">
		<tr>
			<td><label for="new_service">Service </label></td>
			<td><input type="text" name="new_service" id="new_service" /></td>
		</tr>
		<tr>
			<td><label for="new_login">Login </label></td>
			<td><input type="text" name="new_login" id="new_login" /></td>
		</tr>
		<tr>
			<td><label for="new_password">Password </label></td>
			<td><input type="password" name="new_password" id="new_password" /></td>
		</tr>
		<tr>
			<td><label for="new_info">Info </label></td>
			<td><textarea rows="10" id="new_info" name="new_info"></textarea></td>
		</tr>

		</table>
		<form id="add_form" method="POST" action="/">


			<input type="hidden" id="data" name="data" />
			<input type="hidden" id="service" name="service" />
			<input type="submit" value="Add" />
			<input type="reset" value="Reset" />
		</form>


<table id="data_container">
	<thead>
		<tr>
			<th>Decrypt</th>
			<th>Service</th>
			<th>Login</th>
			<th>Password</th>
			<th>Info</th>
		</tr>
	</thead>
	<tbody>
	{% for enc in passwords %}
	<tr id="{{ enc.key }}">
		<td class="action"><input type="checkbox" checked="checked" class="do_decrypt" />
			<div class="none iv">{{ enc.iv }}</div>
		</td>
		<td class="service">{{ enc.service}}</td>
		<td class="login">
			<div class="dec_data">Encrypted</div>
			<div class="enc_data">{{ enc.login }}</div>
		</td>
		<td class="password">
			<div class="dec_data">Encrypted</div>
			<div class="enc_data">{{ enc.password }}</div>
		</td>
		<td class="info">
			<pre class="dec_data">Encrypted</pre>
			<div class="enc_data">{{ enc.info }}</div>
		</td>
	</tr>

	{% endfor %}
	</tbody>
</table>




	{% else %}
		<a href="{{ lurl }}">Login</a>
	{% endif %}

	</div>
</div>


</body>
</html>